CMAKE_MINIMUM_REQUIRED(VERSION 3.0)

include_directories(${COMN_DIR}/include)
include_directories(.)
include_directories(./util)


link_directories(${PROJECT_ROOT}/lib)

include_directories(${PROJECT_ROOT}/http/include)


include_directories(${SQLITE3_INCLUDE_DIR})
link_directories(${SQLITE3_LIBRARY_DIR})

include_directories(${JSONCPP_DIR}/include)

include_directories(${PROJECT_ROOT}/AppUtil)
include_directories(${PROJECT_ROOT}/AppUtil/db)

include_directories(${SOCI_INCLUDE_DIR})
link_directories(${SOCI_LIBRARY_DIR})
include_directories(${PROJECT_ROOT}/dbpool)


if (MSVC)
	SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO")
else()
endif()

if (CMAKE_HOST_WIN32)
	SET(APP_RESOURCE "app.rc")

	include_directories(${PROJECT_ROOT}/CrashDump)
	SET(EXT_LIB debug CrashDumpd optimized CrashDump)

	if(CMAKE_CL_64)
		#
	else()
		
	endif()
	
else()
	SET(APP_RESOURCE "")
endif()

aux_source_directory(util SOURCES)
aux_source_directory(. SOURCES)

add_executable(vhs ${SOURCES} ${APP_RESOURCE})

target_link_libraries(vhs 
	debug AppUtild optimized AppUtil
	${EXT_LIB}
	#${SOFTSERIAL_LIBRARIES}
	debug httpd optimized http
	debug dbpoold optimized dbpool
	debug comnd optimized comn
	debug jsoncppd optimized jsoncpp
	sqlite3
	${SOCI_LIBRARIES}
	${LIB_PLATFORM}
	${FFMPEG_LIBRARIES}
	)

	
install(TARGETS vhs DESTINATION .)

